// logs.js


Page({
  data: {
    latitude: 39.53775,
    longitude: 116.68376
  },
  onLoad(){
  
  },
  onShow(){
    wx.getSetting({
      success(res){
        console.log(res)
      }
    })
    // 定位api 需要在app.json配置
  //   "requiredPrivateInfos":[
  //     "choosePoi",
  //     "chooseAddress",
  //     "getLocation"
  // ],
    wx.getLocation({
      type: 'wgs84',
      altitude:true,
      success :(res)=> {
        console.log(res)
          this.setData({
            latitude:res.latitude,//纬度
            longitude:res.longitude //经度
          })
     
      },
      fail(err){
        console.log(err)
      }
     })
  },
  statechange(e) {
    console.log('live-player code:', e.detail.code)
  },
  statechanges(e) {
    console.log('live-pusher code:', e.detail.code)
  },
  error(e) {
    console.error('live-player error:', e.detail.errMsg)
  }
})
